﻿using RevitMCPSDK.API.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WpfLibrary1
{
    public class CommandRegistry : ICommandRegistry
    {
        Dictionary<string, IRevitCommand> _commands = new Dictionary<string, IRevitCommand>();
        public void RegisterCommand(IRevitCommand command)
        {
            if (!_commands.ContainsKey(command.CommandName))
            {
                _commands.Add(command.CommandName, command);
            }

        }

        public bool TryGetCommand(string commandName, out IRevitCommand command)
        {
           bool ret = _commands.TryGetValue(commandName, out command);
            return true;
        }
    }
}
